home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5196 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  36 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: chang.unx.sas.com!walker
  3. From: walker@chang.unx.sas.com (Doug Walker)
  4. Subject: Re: File sizes
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <Do2vs9.HGu@unx.sas.com>
  7. Date: Mon, 11 Mar 1996 00:52:57 GMT
  8. X-Nntp-Posting-Host: chang.unx.sas.com
  9. References: <4gjs20$i68@btmpjg.god.bel.alcatel.be> <642.6631T1174T964@stud.cs.uit.no> <gertjan.0ay2@a1200.iaehv.nl>
  10. Organization: SAS Institute Inc.
  11.  
  12. In article <gertjan.0ay2@a1200.iaehv.nl>,
  13. Gertjan van Ratingen <gertjan@a1200.iaehv.nl> wrote:
  14. >
  15. >In article <642.6631T1174T964@stud.cs.uit.no> magneoe@stud.cs.uit.no (Magne Oestlyngen) writes:
  16. >> >In article <WXQ7y*5+f@yaps.rhein.de>, arno@yaps.rhein.de (Arno Eigenwillig) writes:
  17. >> >|> > What's the best way of finding out the size of a file? Do I have to use
  18. >> >|> > Examine()
  19. >> >..or do it in ANSI-C, by opening the file, seeking to the end of it
  20. >> >and getting the number of bytes returned from fseek().
  21. >> 
  22. >> fseek() does not return the number of bytes, but 0 if all went fine, non-0 else.
  23. >> Use ftell() to get the position in the file after fseek().
  24.  
  25. Technically, ftell() is only guaranteed accurate if the file was opened in the
  26. binary mode.  ftell() may not be the actual byte count for text files.  In most
  27. (if not all) Amiga implementations, they are identical, but the ANSI standard
  28. allows them to be different.
  29.  
  30. -- 
  31.   *****     
  32.  *|_o_o|\\     Doug Walker   walker@unx.sas.com  
  33.  *|. o.| ||                
  34.   | o  |//     Any opinions are mine, not those of SAS Institute, Inc.
  35.   ====== 
  36.